#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main()
{
	freopen("test.out", "w", stdout);
	int n = 0;
	scanf("%d", &n);
	srand(time(NULL));
	for ( int i = 0; i < 5; i++ )
	{
		int data = rand() % 1000 + 0;
		int k = 1, s = 0;
		for ( int i = 0; i < n; i++ )
		{
			printf("%d ", data);
			if ( rand() % 2 == 1 ) {
				s = 1;
			}
			else {
				s = - 1;
			}
			data = data + s * k;
			k ++;
		}
		printf("\n");
	}
	return 0;
}

